package im.beans;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

/**
 * 用户所拥有的分组
 * @author 凯
 *
 */
@Entity
@Table(name="t_IM_Classify")
public class Classify {
	private long id;
	
	// 分组名
	private String classifyName;
	
	// 分组所属用户
	private User ower;
	
	// 分组所属用户名称 
	private String owerName;
	
	// 分组所含好友数
	private long friendCount;
	
	private long owerID;
	

	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getClassifyName() {
		return classifyName;
	}

	public void setClassifyName(String classifyName) {
		this.classifyName = classifyName;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ower_id",insertable=false,updatable=false)
	public User getOwer() {
		return ower;
	}

	public void setOwer(User user) {
		this.ower = user;
	}

	public String getOwerName() {
		return owerName;
	}

	public void setOwerName(String owerName) {
		this.owerName = owerName;
	}

	public long getFriendCount() {
		return friendCount;
	}

	public void setFriendCount(long friendCount) {
		this.friendCount = friendCount;
	}

	@Column(name="ower_id")
	public long getOwerID() {
		return owerID;
	}

	public void setOwerID(long owerID) {
		this.owerID = owerID;
	}

	
}
